package com.ming.demo.web.impl;

import com.github.pagehelper.PageHelper;
import com.ming.demo.model.Image;
import com.ming.demo.service.ImageService;
import com.ming.demo.web.ImageController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/image")
public class ImageControllerControllerImpl implements ImageController {
    @Autowired
    private ImageService imageService;

    @RequestMapping("/images")
    @Override
    public List<Image> findAllImageList(int pageNo, int pageSize) {
        PageHelper.startPage(pageNo, pageSize);
        return imageService.findAllImage();
    }
}
